mir: only paint background if window has one
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 12 Dec 2014 02:01:38 +0000 (03:01 +0100)
committerWilliam Hua <william@attente.ca>
Thu, 5 Feb 2015 16:26:18 +0000 (17:26 +0100)
gdk/mir/gdkmirwindowimpl.c

index 98ec5256218f2daf69631b1f19c3cd4a27a8361a..fccba87713c4626fc6d774ad582131af7944cf66 100644 (file)
@@ -382,13 +382,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
   impl->cairo_surface = cairo_surface_reference (cairo_surface);
 
   /* Draw background */
-  c = cairo_create (impl->cairo_surface);
   if (impl->background)
-    cairo_set_source (c, impl->background);
-  else
-    cairo_set_source_rgb (c, 1.0, 0.0, 0.0);
-  cairo_paint (c);
-  cairo_destroy (c);
+    {
+      c = cairo_create (impl->cairo_surface);
+      cairo_set_source (c, impl->background);
+      cairo_paint (c);
+      cairo_destroy (c);
+    }
 
   return cairo_surface;
 }